package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.dto.community.CommunitySubwayDto;
import com.yun.zf.common.app.domain.ZfCommunitySubway;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 小区地铁关系表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-03-22
 */
@Mapper
public interface ZfCommunitySubwayMapper extends BaseMapper<ZfCommunitySubway> {

    @Select("<script>" +
            " SELECT cs.community_id ,cs.station_poi ,ss.name stationName, ss.subway_id ,zs.`name` subwayName  from zf_community_subway cs LEFT JOIN zf_subway_station ss   on cs.station_poi = ss.poi_id   LEFT JOIN zf_subway zs on ss.subway_id =zs.id WHERE cs.community_id=#{communityId} " +
            "</script>")
    public List<CommunitySubwayDto> getSubwayList(Long communityId);
}
